﻿using Project.DAL;
using Project.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Project.BLL
{
    public class AuthorityBll : BaseBLL<Authority>
    {
        public override void SetDal()
        {
            Dal =new AuthorityDal();
        }
        //获取用户权限
        public List<Authority> GetAuthorities(int uid) {
            var ulist = new UsersBll().Query().Where(x => x.userID == uid).FirstOrDefault();
            var list = base.Query().Where(x=>x.roleID== ulist.roleID).FirstOrDefault();
            var auth = base.Query().Where(x => x.roleID == list.roleID);
            return auth.ToList();
        }
    }
}
